import { defHttp } from "@/utils/http";
// ERP 退货申请 VO
export interface RetReqVO {
	applyId: number; // 申请单号
	applyDate: Date; // 申请日期
	patId: string; // 病人编号
	exportDate: Date; // 出库日期
	deptId: string; // 科室id
	deptName: string; // 科室名称
	applyPersonId: string; // 申请人ID
}

// ERP 退货申请 API
export const RetReqApi = {
	// 查询退货申请分页
	getRetReqPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/refund-apply/page`, params });
	},

	// 查询退货申请详情
	getRetReq: async (id: number) => {
		return await defHttp.get({ url: `/whs/refund-apply/get?id=` + id });
	},

	// 新增退货申请
	createRetReq: async (data: RetReqVO) => {
		return await defHttp.post({ url: `/whs/refund-apply/create`, data });
	},

	// 修改退货申请
	updateRetReq: async (data: RetReqVO) => {
		return await defHttp.put({ url: `/whs/refund-apply/update`, data });
	},

	// 删除退货申请
	deleteRetReq: async (id: number) => {
		return await defHttp.delete({ url: `/whs/refund-apply/delete?id=` + id });
	},

	// 导出退货申请 Excel
	exportRetReq: async (params: any) => {
		return await defHttp.download({ url: `/whs/refund-apply/export-excel`, params });
	}
};
